import os

from bo.bo import BO

class CheckIn(BO):

    def __init__(self, url, token):
        super(CheckIn, self).__init__(url, token)
        cur_path = os.path.abspath(os.path.dirname(__file__))  # 获取当前文件目录
        parent_path = os.path.dirname(cur_path)
        self.root_path = os.path.dirname(parent_path)
        self.api_info_path = f'{self.root_path}/api_infos/check_in.yaml'

    #获取企业所有打卡规则
    def get_check_in_option(self, params):
        return self.http_request(self.api_info_path, 'get_check_in_option', params)

    #获取员工打卡规则
    def get_member_check_in_option(self, params):
        return self.http_request(self.api_info_path, 'get_member_check_in_option', params)

    #获取打卡记录数据
    def get_check_in_data(self, params):
        return self.http_request(self.api_info_path, 'get_check_in_data', params)

    #获取打卡日报数据
    def get_check_in_daydata(self, params):
        return self.http_request(self.api_info_path, 'get_check_in_daydata', params)